//
//  FilterView1.m
//  YXKitOC
//
//  Created by zhxin on 2020/8/7.
//  Copyright © 2020 张鑫. All rights reserved.
//

#import "FilterView1.h"
#import "YXKitOC.h"
#import "YXTableView.h"
#import "YXFilterObject.h"
#import "CustomTableViewCell1.h"

@implementation FilterView1

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        YXTableView *tableView = [[YXTableView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
        [tableView registCells:@[[CustomTableViewCell1 class]] returnClass:^Class _Nonnull(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            return [CustomTableViewCell1 class];
        } loadCell:^(UITableView * _Nonnull tableView, id  _Nonnull loadCell, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            
            
            
        } returnHeight:^CGFloat(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            return 44;
        } didSelected:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath, id  _Nonnull cellData) {
            
            YXFilterObject *object = [[YXFilterObject alloc] init];
            object.titles = @[@"你好"];
            object.values = @[@"1"];
            object.key = @"filter";
            object.filterPageIndex = self.pageIndex;
            [self.menuFilterDelegate filterPage:self didSelectedObjects:@[object]];
            
        } loadData:^(NSInteger pageIndex, NSInteger pageSize, YXStatusBlock  _Nonnull statusBlock) {
            statusBlock(nil, @[@"", @"", @"", @""]);
        }];
        [self addSubview:tableView];
        
        [tableView reloadData];
    }
    return self;
}


@end
